HASDF: A Generalized LR-parser Generator for Haskell

نویسندگان

  • Merijn de Jonge
  • Tobias Kuipers
  • Joost Visser
چکیده

Language-centered software engineering requires language technology that (i) handles the full class of context-free grammars, and (ii) accepts grammars that contain syntactic information only. The syntax definition formalism SDF combined with GLR-parser generation offers such technology. We propose to make SDF and GLR-parsing available for use with various programming languages. We have done so for the functional programming language Haskell. By combining Haskell data type definitions with the syntax definition formalism SDF we have designed HASDF. HASDF is a domain-specific language in which the concrete syntax of an arbitrary context-free language can be defined in combination with the Haskell data types that represent its abstract syntax. We have implemented a tool that generates a GLR-parser and an unparser from a HASDF definition. 1991 Computing Reviews Classification System: D.1.1, D.1.2, D.2.2, D.2.6, D.2.7, D.3.4

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Generalized LR Parsing in Haskell

Parser combinators elegantly and concisely model generalised LL parsers in a purely functional language. They nicely illustrate the concepts of higherorder functions, polymorphic functions and lazy evaluation. Indeed, parser combinators are often presented as a motivating example for functional programming. Generalised LL, however, has an important drawback: it does not handle (direct nor indir...

متن کامل

GULiveR: GENERALIZED UNIFICATION BASED LR PARSER FOR NATURAL LANGUAGES

GULiveR (The Generalized Unification Based LR Parser) is an environment for parsing natural languages, written and developed at the Romanian Academy of Sciences, Center for Artificial Intelligence. As its name indicates, GULiveR is based on unification and its purpose is the development of applications involving natural language analysis. The environment consists of a parser, a parse table gene...

متن کامل

Layout-Sensitive Generalized Parsing

The theory of context-free languages is well-understood and context-free parsers can be used as off-the-shelf tools in practice. In particular, to use a context-free parser framework, a user does not need to understand its internals but can specify a language declaratively as a grammar. However, many languages in practice are not context-free. One particularly important class of such languages ...

متن کامل

Principled Parsing for Indentation-Sensitive Languages

Many languages, such as Haskell, Python, and F#, use the indentation and layout of code as part of their syntax. Because context-free grammars are not able to express these layout rules, existing parsers use ad hoc techniques to handle them. These techniques tend to be low-level and operational in nature, and thus forgo the advantages of more declarative specifications like context-free grammar...

متن کامل

A preliminary report on generalized LR parsing for Boolean grammars

The generalized LR parsing algorithm for context-free grammars, invented by Tomita in 1986, is extended for the case of Boolean grammars – a recently introduced generalization of context-free grammars with logical connectives added to the formalism of rules. A high-level description of the algorithm, an elaborate example of its operation and a suggested implementation are provided. The algorith...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999